#pragma once
#include <vector>
#include <fstream>
#include <string>

namespace xpam
{
    namespace frame
    {
        template<class t_pixel>
        class frame : public std::vector<t_pixel>
        {
        public:
            int width, height;

            void from_raw(const std::string & location)
            {
                std::ifstream fin(location.c_str(), std::ios::binary);
                fin.read((char*)&width, sizeof(int));
                fin.read((char*)&height, sizeof(int));
                resize(width * height);
                fin.read((char*)(&((*this)[0])), width * height * sizeof(t_pixel));
                fin.close();
            }

        };
    }
}